package ch.jamme.conf;

/**
 * Converts an object in its String representation and conversely a String in the Object that it represents (given its Class)
 * @author Mario Fusco
 */
public interface ObjectToStringConvertor {

	/**
	 * Converts an object in its representation as a String
	 * @param object The object to be converted
	 * @return The String representing the object
	 */
	String toString(Object object);
	
	/**
	 * Instanciate an Object starting from its Class and its representation as a String
	 * @param clazz The Class of the object to be instanciated
	 * @param asString The object's String representation
	 * @return The instanciated Object of the given Class and having the given String representation
	 */
	Object toObject(Class<?> clazz, String asString);
}
